package paidaxing.blog.common.constant;

/**
 * 用户常量类
 *
 * @author heefM
 * @date 2025-10-17
 */
public class UserConstant {

    /**
     * 用户状态
     */
    public static final String USER_STATUS_ACTIVE = "ACTIVE";
    public static final String USER_STATUS_INACTIVE = "INACTIVE";
    public static final String USER_STATUS_BANNED = "BANNED";

    /**
     * 用户角色
     */
    public static final String USER_ROLE_ADMIN = "ADMIN";
    public static final String USER_ROLE_USER = "USER";

    /**
     * 默认密码
     */
    public static final String DEFAULT_PASSWORD = "123456";

    /**
     * 用户相关限制
     */
    public static final int USERNAME_MIN_LENGTH = 4;
    public static final int USERNAME_MAX_LENGTH = 16;
    public static final int PASSWORD_MIN_LENGTH = 6;
    public static final int PASSWORD_MAX_LENGTH = 18;
    public static final int NICKNAME_MIN_LENGTH = 2;
    public static final int NICKNAME_MAX_LENGTH = 20;

    /**
     * 登录相关
     */
    public static final String LOGIN_USER_KEY = "login_user";
    public static final String TOKEN_HEADER = "Authorization";
    public static final String TOKEN_PREFIX = "pdx "; //Bearer

    /**
     * 缓存key
     */
    public static final String CACHE_USER_KEY = "user:";
    public static final long CACHE_USER_TTL = 30 * 60L; // 30分钟

    // 异常码
    public static final String USERNAME_EXIST = "用户名已存在";
    public static final String EMAIL_EXIST = "邮箱已注册";
}
